package com.TheyChat.service.config.mybatis;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: victor.w.ye
 * @Date: 2021/2/23 9:44
 * @Copyright:
 * @Company: luban
 * @Version: 1.0.0
 **/
@Configuration
@MapperScan("com.TheyChat.service.interfaces.mapper*")
public class MybatisPlusConfig {

    // 分页插件：
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
        return interceptor;
    }
}
